Data storage and retrieval systems, such as databases, often allow multiple access connections. For example, databases often allow more than one processor to access the same portion of the database. To maintain data integrity, synchronization objects such as latches may be used when a database allows multiple access connections. In a typical implementation, a latch associated with a particular data structure of a database is acquired by a processor before the processor can write to the particular data structure. When the particular data structure is frequently accessed, the latch may become “contended” or “hot” and the process of acquiring the latch may become a bottleneck that reduces the overall performance of the database. Latch acquisition operations may involve modifications of specific memory locations of a computing system. Therefore, latch acquisition may not scale in typical cache-coherent microprocessor designs when multiple processors attempt to modify or read the same memory location at the same time. For example, when 8 processors attempt to acquire the same latch, the acquisition operation may not simply be 8 times slower, but instead may be hundreds of times slower.
One way to resolve latch contention is by partitioning the contended latch. When a latch is partitioned, a separate copy of the latch may be created for each processor. Some systems partition a latch based on a static threshold such as the number of times the latch is acquired during a particular time period (e.g., the number of latch acquisitions per minute). However, when a large number of processors are forced to wait for a particular latch, the static threshold may not be reached even though the particular latch is in a state of contention.